package com.ihg.dec.apps.preparer;

import org.apache.tiles.AttributeContext;
import org.apache.tiles.context.TilesRequestContext;
import org.apache.tiles.preparer.ViewPreparer;
import org.springframework.beans.factory.annotation.Autowired;

public class TestViewPreparer implements ViewPreparer {

	@Autowired
	private MessageBean messageBean;
	
	private String message;
	
	public void setMessage(String message) {
		this.message = message;
	}
	
	@Override
	public void execute(TilesRequestContext tilesContext,
			AttributeContext attributeContext) {

		tilesContext.getRequestScope().put("testValueForPreparer", message);
		tilesContext.getRequestScope().put("anotherTestMessage", messageBean.getMessage());

	}

}
